package stock.data;

import java.io.IOException;
import java.sql.SQLException;
import java.text.ParseException;


/**
 * Database initialization
 * @author i062843
 *
 */
public class DatabaseProvider {

	static String MYSQL_JDBC_DRIVER = "com.mysql.jdbc.Driver";
	static String DATABASE_URL = "jdbc:mysql://localhost:3306/" + DatabaseMetadata.DATABASE_NAME;
	
	public void initData() throws SQLException, IOException, ParseException
	{
		DatabaseImpl db = new DatabaseImpl();
		db.initDatabase(MYSQL_JDBC_DRIVER, DATABASE_URL, "admin", "admin");
		//Database db = new Database(MYSQL_JDBC_DRIVER, DATABASE_URL, "admin", "admin");
		
		db.truncateTables();
		
		//add 399005
		db.populateTable("399005", "SME board", "399005.txt");
		
		//TODO: add other board
	}
	
}
